<template>
    <div class="queque_ren" v-if="queRenViewOption.showView">
        <div class="content">
            <div class="title">{{ queRenViewOption.title }}</div>
            <div class="cont">{{ queRenViewOption.cont }}</div>
            <div class="btns" v-if="queRenViewOption.type == 1">
                <button @click="sunbit(1)">确定</button>
                <button @click="sunbit(2)">取消</button>
            </div>
            <div class="btns" v-if="queRenViewOption.type == 2">
                <button @click="sunbit(1)">确定</button>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    props: {
        queRenViewOption: {
            type: Object,
            default: () => {
                return {
                    showView: false,
                    title: '',
                    cont: '',
                    type: 2
                }
            }
        },
    },
    methods: {
        sunbit(v) {
            if (v == 1) {
                this.$emit('sumbit', 1)
            } else {
                this.$emit('sumbit', 2)
            }
        }
    },
    components: {

    },
};
</script>

<style scoped lang="less">
.queque_ren {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;

    .content {
        box-shadow: 0 0 1px 1px #9a9a9a;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: #f0f0f0;
        width: 270px;
        height: 120px;
        border-radius: 5px;
        z-index: 10;
    }

    .title {
        background-color: #f3f3f3;
        line-height: 25px;
        padding: 0 5px;
    }

    .cont {
        line-height: 50px;
        text-align: center;
    }

    .btns {
        text-align: right;
        padding: 0 20px;
        padding-top: 8px;

        button {
            border: 1px solid #9a9a9a;
            border-radius: 3px;
            background-color: #fdfdfd;
            margin-left: 10px;
            font-size: 12px;
            width: 80px;
            line-height: 20px
        }

        button:active {
            border-color: #63a9df;
        }
    }
}
</style>
